#include <cstdio>
#include <cstring>
#include <cmath>
#include <iostream>
#include <algorithm> 
using namespace std;
int main()
{
	long long x1,x2,y1,y2;
	long long u1,u2,v1,v2;
	while(scanf("%I64d %I64d %I64d %I64d",&x1,&y1,&x2,&y2)!=EOF)
	{
		scanf("%I64d %I64d %I64d %I64d",&u1,&v1,&u2,&v2);
		long long l,r,u,d;
		long long ans1 = 0;
		long long ans2 = 0;
		long long ans = 0;
		l = max(min(x1,x2),min(u1,u2));
		r = min(max(x1,x2),max(u1,u2));
		d = max(min(y1,y2),min(v1,v2));
		u = min(max(y1,y2),max(v1,v2));
		if(r-l<=0||u-d<=0) ans = 0;
		else ans = (r-l)*(u-d);
		//printf("****%d %d\n",r-l,u-d);
		ans1 = abs(x2-x1)*abs(y2-y1);
		ans2 = abs(u2-u1)*abs(v2-v1);
		printf("%I64d\n",ans1+ans2-ans);
	}
}
